import {customeStruct} from '../utils';
const itf = customeStruct.interface;

const defaultProps = {
    id: 'string',
    code: 'string',
    name: 'string',
    shortCode: 'string? | null',
    shortName: 'string? | null',
    country: 'string? | null',
    province: 'string? | null',
    city: 'string? | null',
    contactNumber: 'string? | null',
    address: 'string? | null',
    fax: 'string?|null'
};

export const init = itf({
    payload: itf({
        isDealerUser: 'boolean',
        brands: [itf({
            id: 'string',
            code: 'string',
            name: 'string'
        })],
        tradeMethods: [itf({
            id: 'string',
            code: 'string',
            name: 'string'
        })],
    })
});

export const list = itf({
    payload: itf({
        content: [itf(Object.assign({
            options: ['string']
        }, defaultProps))],
        totalElements: 'number',
    })
});

export const detail = itf({
    payload: itf({
        id: 'string',
        code: 'string',
        name: 'string',
        shortCode: 'string?|null',
        shortName: 'string?|null',
        kind: 'number?|null',
        area: 'string?|null',
        country: 'string?|null',
        province: 'string?|null',
        city: 'string?|null',
        contactNumber: 'string?|null',
        fax: 'string?|null',
        address: 'string?|null',
        zipCode: 'string?|null',
    })
});

export const personnel = itf({
    payload: itf({
        content: [itf({
            id: 'string',
            userName: 'string',
            name: 'string',
        })],
    })
});

